<template>
   <div>
   </div>
</template>
<script lang = "ts">
//测试axios.ts
import { defineComponent, getCurrentInstance } from 'vue'
export default defineComponent({
  name: 'test',
  setup() {
    const { proxy }: any = getCurrentInstance()
    function ajaxTest() {
      proxy.$http
        .get(`/api/index`)
        .then((result: any) => {
           const  {data} = result
          console.log(data, 'result')
        })
        .catch((err: any) => {
          console.log(err, 'err')
        })
    }

    ajaxTest()
  }
  
})
</script>
